package org.azj.dbOperatorComponent;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;


/**
 * 此接口展示了可以获得的实体表的所有属性
 */
public interface IBasicTableOperation 
{
	
	// table schema (may be null)  
	public String GetTableSchema();
	
	// table name   
	public String getTableName();
	
	// full name - Schema.Name
	public String getTableFullName();
	
	// table type. 
	// Typical types are "TABLE", "VIEW", "SYSTEM TABLE", 
	// "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM". 
	public String getTableType() throws SQLException ;
	
	// table columns， key is full columnName, that is schema.tableName.columnName (upper)
	// while value is IColumnProperty column name is only the short name, without schema and table info
	public HashMap<String , IColumnProperty> getAllColumns() throws SQLException;
	
	// get table column according to the column name,
	// columnName should not contain the schema and table name
	// column name can be full name or only the short name
	public IColumnProperty getColumn(String columnName) throws SQLException;
	
	// primary keys 
	// primary keys can have more than one columns,
	// but one table can only have one primary key
	// key is full columnName, that is schema.tableName.columnName (upper)
	public HashMap<String , IColumnProperty> getPrimaryKey() throws SQLException ;
	
	// foreign keys
	// foreign keys can have more than one columns,
	// and one table can have multiple foreign key
	public List< List<IForeignKeyColumnProperty>> getForeignKey() throws SQLException ;	
}
